<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="inner"></div>
</body>
<script>
    var inner = document.querySelector('.inner');
    var d1 = +new Date();
    // var str = '';
    // for (var i = 0; i < 1000; i++) {
    //     document.body.innerHTML += '<a href="#">百度</a>'
    // }
    var arr = [];
    for (var i = 0; i < 1000; i++) {
        arr.push('<a href="#">百度</a>');
    }
    inner.innerHtml = arr.join(' ');
    var d2 = +new Date();
    console.log(d2 - d1);
</script>

</html>